package org.dormi.learn.event;


import org.dormi.learn.BaseSerializable;

import java.time.LocalDateTime;

/**
 * 消息
 *
 * @author : dormi330
 * @version : 1.0
 */
public class BaseEvent extends BaseSerializable {

    // 消息自身信息
    private String type;
    private String body;
    private String bizId;

    // 存储相关信息
    private Long id;
    private Integer publishState;
    private LocalDateTime publishTime;

    /* === constructor === */

    public BaseEvent() {
    }

    public BaseEvent(String type, String bizId, String body) {
        this.type = type;
        this.bizId = bizId;
        this.body = body;

        //
        publishState = EventStateEnum.NOT_PUBLISH.value;
    }

    public BaseEvent(String type, Long bizId, String body) {
        this.type = type;
        this.bizId = String.valueOf(bizId);
        this.body = body;

        //
        publishState = EventStateEnum.NOT_PUBLISH.value;
    }

    /* === setter / getter === */
    /* === setter / getter === */
    /* === setter / getter === */

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String getBizId() {
        return bizId;
    }

    public void setBizId(String bizId) {
        this.bizId = bizId;
    }

    public Integer getPublishState() {
        return publishState;
    }

    public void setPublishState(Integer publishState) {
        this.publishState = publishState;
    }

    public LocalDateTime getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(LocalDateTime publishTime) {
        this.publishTime = publishTime;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}
